temporary implementation of action signal "debug_msg"
authorTim Janik <timj@gtk.org>
Wed, 1 Jul 1998 19:36:53 +0000 (19:36 +0000)
committerTim Janik <timj@src.gnome.org>
Wed, 1 Jul 1998 19:36:53 +0000 (19:36 +0000)
Wed Jul  1 20:58:46 1998  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.h:
        * gtk/gtkwidget.c: temporary implementation of action signal "debug_msg"

        * gtk/gtkbindings.c (gtk_binding_entry_add_signal): fixed an off-by-one
        error that prevented signal to entry addition for signals with
        parameters.

13 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkaccelgroup.c
gtk/gtkbindings.c
gtk/gtkbindings.h
gtk/gtkitemfactory.c
gtk/gtkwidget.c
gtk/gtkwidget.h

index 618f4fe52f843e152b5d0c7ddc0e0a4e3517f5a9..325660864847b846a14df67c2c055d7da8caf059 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Wed Jul  1 20:58:46 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwidget.h:
+       * gtk/gtkwidget.c: temporary implementation of action signal "debug_msg"
+
+       * gtk/gtkbindings.c (gtk_binding_entry_add_signal): fixed an off-by-one
+       error that prevented signal to entry addition for signals with
+       parameters.
+
 Wed Jul  1 10:05:36 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * ltconfig: fix for properly detecting shared lib support on
index 618f4fe52f843e152b5d0c7ddc0e0a4e3517f5a9..325660864847b846a14df67c2c055d7da8caf059 100644 (file)
@@ -1,3 +1,12 @@
+Wed Jul  1 20:58:46 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwidget.h:
+       * gtk/gtkwidget.c: temporary implementation of action signal "debug_msg"
+
+       * gtk/gtkbindings.c (gtk_binding_entry_add_signal): fixed an off-by-one
+       error that prevented signal to entry addition for signals with
+       parameters.
+
 Wed Jul  1 10:05:36 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * ltconfig: fix for properly detecting shared lib support on
index 618f4fe52f843e152b5d0c7ddc0e0a4e3517f5a9..325660864847b846a14df67c2c055d7da8caf059 100644 (file)
@@ -1,3 +1,12 @@
+Wed Jul  1 20:58:46 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwidget.h:
+       * gtk/gtkwidget.c: temporary implementation of action signal "debug_msg"
+
+       * gtk/gtkbindings.c (gtk_binding_entry_add_signal): fixed an off-by-one
+       error that prevented signal to entry addition for signals with
+       parameters.
+
 Wed Jul  1 10:05:36 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * ltconfig: fix for properly detecting shared lib support on
index 618f4fe52f843e152b5d0c7ddc0e0a4e3517f5a9..325660864847b846a14df67c2c055d7da8caf059 100644 (file)
@@ -1,3 +1,12 @@
+Wed Jul  1 20:58:46 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwidget.h:
+       * gtk/gtkwidget.c: temporary implementation of action signal "debug_msg"
+
+       * gtk/gtkbindings.c (gtk_binding_entry_add_signal): fixed an off-by-one
+       error that prevented signal to entry addition for signals with
+       parameters.
+
 Wed Jul  1 10:05:36 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * ltconfig: fix for properly detecting shared lib support on
index 618f4fe52f843e152b5d0c7ddc0e0a4e3517f5a9..325660864847b846a14df67c2c055d7da8caf059 100644 (file)
@@ -1,3 +1,12 @@
+Wed Jul  1 20:58:46 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwidget.h:
+       * gtk/gtkwidget.c: temporary implementation of action signal "debug_msg"
+
+       * gtk/gtkbindings.c (gtk_binding_entry_add_signal): fixed an off-by-one
+       error that prevented signal to entry addition for signals with
+       parameters.
+
 Wed Jul  1 10:05:36 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * ltconfig: fix for properly detecting shared lib support on
index 618f4fe52f843e152b5d0c7ddc0e0a4e3517f5a9..325660864847b846a14df67c2c055d7da8caf059 100644 (file)
@@ -1,3 +1,12 @@
+Wed Jul  1 20:58:46 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwidget.h:
+       * gtk/gtkwidget.c: temporary implementation of action signal "debug_msg"
+
+       * gtk/gtkbindings.c (gtk_binding_entry_add_signal): fixed an off-by-one
+       error that prevented signal to entry addition for signals with
+       parameters.
+
 Wed Jul  1 10:05:36 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * ltconfig: fix for properly detecting shared lib support on
index 618f4fe52f843e152b5d0c7ddc0e0a4e3517f5a9..325660864847b846a14df67c2c055d7da8caf059 100644 (file)
@@ -1,3 +1,12 @@
+Wed Jul  1 20:58:46 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwidget.h:
+       * gtk/gtkwidget.c: temporary implementation of action signal "debug_msg"
+
+       * gtk/gtkbindings.c (gtk_binding_entry_add_signal): fixed an off-by-one
+       error that prevented signal to entry addition for signals with
+       parameters.
+
 Wed Jul  1 10:05:36 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * ltconfig: fix for properly detecting shared lib support on
index c8c3e908f4e4f80ae71ac33e2f7d3ab230478b05..9a65f07318d0537c24539080cd0e4b639c231514 100644 (file)
@@ -965,9 +965,9 @@ gchar*
 gtk_accelerator_name (guint           accelerator_key,
                      GdkModifierType accelerator_mods)
 {
+  static const gchar text_release[] = "<Release>";
   static const gchar text_shift[] = "<Shift>";
   static const gchar text_control[] = "<Control>";
-  static const gchar text_release[] = "<Release>";
   static const gchar text_mod1[] = "<Alt>";
   static const gchar text_mod2[] = "<Mod2>";
   static const gchar text_mod3[] = "<Mod3>";
@@ -984,12 +984,12 @@ gtk_accelerator_name (guint           accelerator_key,
     keyval_name = "";
 
   l = 0;
+  if (accelerator_mods & GDK_RELEASE_MASK)
+    l += sizeof (text_release) - 1;
   if (accelerator_mods & GDK_SHIFT_MASK)
     l += sizeof (text_shift) - 1;
   if (accelerator_mods & GDK_CONTROL_MASK)
     l += sizeof (text_control) - 1;
-  if (accelerator_mods & GDK_RELEASE_MASK)
-    l += sizeof (text_release) - 1;
   if (accelerator_mods & GDK_MOD1_MASK)
     l += sizeof (text_mod1) - 1;
   if (accelerator_mods & GDK_MOD2_MASK)
@@ -1006,6 +1006,11 @@ gtk_accelerator_name (guint           accelerator_key,
 
   l = 0;
   accelerator[l] = 0;
+  if (accelerator_mods & GDK_RELEASE_MASK)
+    {
+      strcpy (accelerator + l, text_release);
+      l += sizeof (text_release) - 1;
+    }
   if (accelerator_mods & GDK_SHIFT_MASK)
     {
       strcpy (accelerator + l, text_shift);
@@ -1016,11 +1021,6 @@ gtk_accelerator_name (guint           accelerator_key,
       strcpy (accelerator + l, text_control);
       l += sizeof (text_control) - 1;
     }
-  if (accelerator_mods & GDK_RELEASE_MASK)
-    {
-      strcpy (accelerator + l, text_release);
-      l += sizeof (text_release) - 1;
-    }
   if (accelerator_mods & GDK_MOD1_MASK)
     {
       strcpy (accelerator + l, text_mod1);
index 8c17c9f5dfaab8ffa9e2b384b26262434329efe0..49a0dbacb7e5b8adafbe72bfc1f8f279fc26b6af 100644 (file)
@@ -647,19 +647,19 @@ gtk_binding_entry_add_signal (GtkBindingSet  *binding_set,
          if (!arg->d.string_data)
            {
              g_warning ("gtk_binding_entry_add_signal(): value of `string' arg[%u] is `NULL'", i);
-             i = n_args + 2;
+             i += n_args + 1;
            }
          break;
        default:
          g_warning ("gtk_binding_entry_add_signal(): unsupported type `%s' for arg[%u]",
                     gtk_type_name (arg->arg_type), i);
-         i = n_args + 2;
+         i += n_args + 1;
          break;
        }
     }
   va_end (args);
 
-  if (i == n_args + 1 || i == 0)
+  if (i == n_args || i == 0)
     {
       slist = g_slist_reverse (slist);
       gtk_binding_entry_add_signall (binding_set, keyval, modifiers, signal_name, slist);
index d9ed4033d8c47b4800d7395245a1df1b7b3b6d8a..5252299a85324f3e50686c6b8aee77d229b20614 100644 (file)
@@ -61,15 +61,17 @@ gboolean gtk_pattern_match_simple   (const gchar     *pattern,
                                     const gchar         *string);
 
 
-/* Binding sets
+/* type arguments for internal use only
  */
-
 #define        GTK_BINDING_ARG_INT     (GTK_TYPE_INT)
 #define        GTK_BINDING_ARG_LONG    (GTK_TYPE_LONG)
 #define        GTK_BINDING_ARG_FLOAT   (GTK_TYPE_FLOAT)
 #define        GTK_BINDING_ARG_DOUBLE  (GTK_TYPE_DOUBLE)
 #define        GTK_BINDING_ARG_STRING  (GTK_TYPE_STRING)
 
+/* Binding sets
+ */
+
 typedef struct _GtkBindingSet          GtkBindingSet;
 typedef struct _GtkBindingEntry                GtkBindingEntry;
 typedef struct _GtkBindingSignal       GtkBindingSignal;
index 76b9454d20ac2194cd07bff57423f97e275b60b7..43d988834581e8f2b24d15b362c1dbdcba10772e 100644 (file)
@@ -579,10 +579,12 @@ gtk_item_factory_construct (GtkItemFactory        *ifactory,
                    NULL);
   gtk_object_ref (GTK_OBJECT (ifactory));
   gtk_object_sink (GTK_OBJECT (ifactory));
-  gtk_signal_connect_object_while_alive (GTK_OBJECT (ifactory->widget),
+  /*
+    gtk_signal_connect_object_while_alive (GTK_OBJECT (ifactory->widget),
                                         "destroy",
-                                        GTK_SIGNAL_FUNC (gtk_widget_destroy),
+                                        GTK_SIGNAL_FUNC (gtk_object_destroy),
                                         GTK_OBJECT (ifactory));
+  */
   gtk_item_factory_add_item (ifactory,
                             "", NULL,
                             NULL, 0, NULL, 0,
index 18404fb3193cd4d5f237cb51cf0ccf894c1b2825..680dabac188621de44d2b0636396efc49d5974bc 100644 (file)
@@ -85,6 +85,7 @@ enum {
   CLIENT_EVENT,
   NO_EXPOSE_EVENT,
   VISIBILITY_NOTIFY_EVENT,
+  DEBUG_MSG,
   LAST_SIGNAL
 };
 
@@ -286,6 +287,13 @@ gtk_widget_get_type (void)
  *
  *   results:
  *****************************************/
+#include "stdio.h"
+static void
+gtk_widget_debug_msg (GtkWidget          *widget,
+                     const gchar        *string)
+{
+  fprintf (stderr, "Gtk-DEBUG: %s\n", string);
+}
 
 static void
 gtk_widget_class_init (GtkWidgetClass *klass)
@@ -687,6 +695,14 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                    gtk_widget_marshal_signal_4,
                    GTK_TYPE_BOOL, 1,
                    GTK_TYPE_GDK_EVENT);
+  widget_signals[DEBUG_MSG] =
+    gtk_signal_new ("debug_msg",
+                   GTK_RUN_LAST | GTK_RUN_ACTION,
+                   object_class->type,
+                   GTK_SIGNAL_OFFSET (GtkWidgetClass, debug_msg),
+                   gtk_widget_marshal_signal_1,
+                   GTK_TYPE_NONE, 1,
+                   GTK_TYPE_STRING);
 
   gtk_object_class_add_signals (object_class, widget_signals, LAST_SIGNAL);
 
@@ -742,8 +758,10 @@ gtk_widget_class_init (GtkWidgetClass *klass)
   klass->drop_enter_event = NULL;
   klass->drop_leave_event = NULL;
   klass->drop_data_available_event = NULL;
-  klass->other_event = NULL;
   klass->no_expose_event = NULL;
+  klass->other_event = NULL;
+
+  klass->debug_msg = gtk_widget_debug_msg;
 
   /* bindings test
    */
@@ -751,8 +769,11 @@ gtk_widget_class_init (GtkWidgetClass *klass)
     GtkBindingSet *binding_set;
 
     binding_set = gtk_binding_set_by_class (klass);
-    gtk_binding_entry_add_signal (binding_set, '9', GDK_CONTROL_MASK|GDK_RELEASE_MASK, "hide", 0);
-    gtk_binding_entry_add_signal (binding_set, '9', GDK_CONTROL_MASK|GDK_RELEASE_MASK, "show", 0);
+    gtk_binding_entry_add_signal (binding_set,
+                                 '9', GDK_CONTROL_MASK | GDK_RELEASE_MASK,
+                                 "debug_msg",
+                                 1,
+                                 GTK_TYPE_STRING, "GtkWidgetClass test");
   }
 }
 
index 9f75a4b1cd7ccc9074043b218cbd4d3a2280b5bc..420b3f38eec14cd2958db76d65c4d53d4287df41 100644 (file)
@@ -337,6 +337,10 @@ struct _GtkWidgetClass
   /* selection */
   void (* selection_received)      (GtkWidget          *widget,
                                    GtkSelectionData   *selection_data);
+
+  /* action signals */
+  void (* debug_msg)              (GtkWidget          *widget,
+                                   const gchar        *string);
 };
 
 struct _GtkWidgetAuxInfo